package com.blogspot.dizpers.scribendi.plugins;

import com.blogspot.dizpers.scribendi.plugins.plugincontainer.IPluginContainer;
import com.blogspot.dizpers.scribendi.plugins.plugincontainer.PluginContainerModule;
import com.blogspot.dizpers.scribendi.plugins.plugincontainer.PluginProvider;
import com.google.inject.Guice;
import com.google.inject.Injector;

public class PluginManager {
	private IPluginContainer pluginContainer;
	private PluginProvider pluginProvider;
	
	public PluginManager() {
		Injector injector = Guice.createInjector(new PluginContainerModule());
		pluginContainer = injector.getInstance(IPluginContainer.class);
		pluginProvider = injector.getInstance(PluginProvider.class);
	}
	
	public String[] getPluginNames() {
		return pluginProvider.getPluginNames(); 
	}
	
	public String[] getPluginPaths() {
		return pluginProvider.getPluginPaths();
	}
	
	public void runPlugin(String sPlugin) {
		pluginContainer.run(sPlugin);
	}
}
